#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, v, x, y;
	cin>>n>>v;
	int cnt = 0;
	while(n--)
	{
		cin>>x>>y;
		if(v > y)
			cnt++;
	}
	cout<<cnt;
	return 0;
}

